/*******************************************************************************
 * Copyright (c) 2005, 2014 springside.github.io
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package com.yihu.wlyy.repository;

import java.util.List;

import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import com.yihu.wlyy.entity.doctor.DoctorMedicalRecordsPart;

public interface DoctorMedicalRecordsPartDao extends PagingAndSortingRepository<DoctorMedicalRecordsPart, Long>, JpaSpecificationExecutor<DoctorMedicalRecordsPart> {
	
	DoctorMedicalRecordsPart findByCode(String part);
	
	//查询医生的片段分类
	@Query("select a from DoctorMedicalRecordsPart a where (a.doctor = ?1 or a.doctor is null) and a.del = '1'")
	List<DoctorMedicalRecordsPart> findByDoctor(String doctor);
	
}
